<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="js/vue.js"></script>
  <script src="views/Index.js"></script>
  <script src="views/Details.js"></script>
  <script src="views/NotFound.js"></script>
  <script src="js/vue-router.js"></script>
  <script src="router/index.js"></script>
  <script src="components/MyHeader.js"></script>
</head>
<body>
  <div id="app">
    <!--让所有页面都有页头-->
    <my-header></my-header>
    <router-view></router-view>
  </div>
  <script>
    //将普通子组件MyHeader转为全局组件
    Vue.component("my-header",MyHeader);
    
    new Vue({
      el:"#app",
      router  //定义了地址的转发方式
    })
  </script>
</body>
</html>
